package org.hengguan;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.net.UnknownHostException;

@Slf4j
@EnableScheduling
@EnableAsync
@SpringBootApplication
public class HengguanApiContestApplication {

	public static void main(String[] args) throws UnknownHostException {
		ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(HengguanApiContestApplication.class, args);
		Environment environment = configurableApplicationContext.getEnvironment();
		String name = environment.getProperty("spring.application.name");
	    String port = environment.getProperty("server.port");
	    String path = environment.getProperty("server.servlet.context-path");
	    log.info("\n-------------------------------------------------------------------------\n\t" +
	            "Application "+name+" is running!\n\t" +
	            "Swagger-UI: http://localhost:" + port + path + "/doc.html\n" +
	            "-------------------------------------------------------------------------");
		
	}
}
